package hk.edu.polyu.comp.motioncapture.linklist;

public class ListNode {
	// package access members; List can access these directly
	Object data;
	ListNode nextNode, prevNode;

	// constructor creates a ListNode that refers to object
	ListNode(Object object) {
		this(object, null, true);
	}

	// constructor creates ListNode that refers to
	// Object and to next ListNode
	ListNode(Object object, ListNode node, boolean isAddFront) {
		data = object;
		if (isAddFront)
			nextNode = node;
		else
			prevNode = node;
	}

	// return reference to data in node
	Object getObject() {
		return data;
	}

	// return reference to next node in list
	ListNode getNext() {
		return nextNode; // get next node
	}

	// return reference to prev node in list
	ListNode getPrev() {
		return prevNode; // get next node
	}
}
